<%--
  Created by IntelliJ IDEA.
  User: wujia
  Date: 2017/7/19
  Time: 18:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="stylesheet" href="../../static/common/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="../../static/common/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../static/css/global.css">
    <link rel="stylesheet" href="../../static/css/table.css">
    <script src="../../static/common/axios.min.js"></script>
    <script src="../../static/common/vue.min.js"></script>
    <script src="../../static/common/layui/layui.js"></script>
    <script>
        var  publisherid = ${sessionScope.currentUser.getId()};
    </script>
</head>
<div style="margin: 15px;"  id="Vue" v-cloak>

    <div v-show="show">
        <blockquote class="layui-elem-quote">
            <form action="" method="post" class="layui-form">
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <select id="department" name="department" lay-filter="department"  class="layui-input"lay-search>
                        <option value="">选择系部</option>
                    </select>
                </div>
                <div class="layui-input-inline" >
                    <select id="major" name="major" lay-filter="major"  class="layui-input"lay-search>
                        <option value="">选择专业</option>
                    </select>
                </div>
                <div class="layui-input-inline" >
                    <select id="clazz" name="clazz" lay-filter="clazz"  class="layui-input"lay-search>
                        <option value="">选择班级</option>
                    </select>
                </div>

                <div class="layui-input-inline" style="width: 120px">
                    <select  id="state" name="state" lay-filter="state" class="layui-input" >
                        <option value="" >实习状态</option>
                        <option value="1" >未实习</option>
                        <option value="2" >实习申请中</option>
                        <option value="3" >实习中</option>
                    </select>
                </div>
                <div class="layui-input-inline" style="width: 100px">
                    <select id="teacher" name="teacher" lay-filter="teacher"  class="layui-input"lay-search>
                        <option value="">指导老师</option>
                    </select>
                </div>
                <div class="layui-input-inline" style="width: 100px">
                    <select id="intern" name="intern" lay-filter="intern"  class="layui-input"lay-search>
                        <option value="">实习企业</option>
                    </select>
                </div>

                <input type="button" class="layui-btn" @click="selectState" value="筛选">
                <input type="reset" class="layui-btn" @click="removeSelectState" value="重置">
            </div>
            </form>
        </blockquote>
        <fieldset class="layui-elem-field">
            <legend>实习信息</legend>
            <div class="layui-field-box layui-form">
                <table class="layui-table admin-table">
                    <thead>
                    <tr>
                        <th>学号</th>
                       <th>姓名</th>
                        <th>实习企业</th>
                        <th>岗位</th>
                        <th>校内指导老师</th>
                        <th>实习状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <%--内容容器--%>
                    <tbody id="content">
                    </tbody>
                </table>
            </div>
        </fieldset>

        <%--分页容器--%>
        <div class="admin-table-page">
            <div id="paged" class="page">
            </div>
        </div>
    </div>

    <%--审核,详情--%>
    <div v-show="interninfoShow">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>实习信息</legend>
        </fieldset>
        <form class="layui-form" >
            <div class="layui-form-item">
                <label class="layui-form-label" >姓名</label>
                <div class="layui-input-block">
                    <input name="name" class="layui-input" disabled="disabled" v-model="studentInfoDetail.user.realname">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">专业</label>
                <div class="layui-input-block">
                    <input name="major" class="layui-input"v-model="studentInfoDetail.major.name">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" >班级</label>
                <div class="layui-input-block">
                    <input name="clazz" class="layui-input" disabled="disabled" v-model="studentInfoDetail.clazz.name">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" >企业</label>
                <div class="layui-input-block">
                    <input name="fullname" class="layui-input" disabled="disabled" v-model="orgInfo.fullname">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" >实习岗位</label>
                <div class="layui-input-block">
                    <input name="position" class="layui-input" disabled="disabled" v-model="interninfo.position">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" >实习内容</label>
                <div class="layui-input-block">
                    <input name="jobcontent" class="layui-input" disabled="disabled" v-model="interninfo.jobcontent">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label" >实习开始时间</label>
                <div class="layui-input-block">
                    <input name="start" class="layui-input" disabled="disabled" v-model="interninfo.start">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label" >实习结束时间</label>
                <div class="layui-input-block">
                    <input name="end" class="layui-input" disabled="disabled" v-model="interninfo.end">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label" >指导老师姓名</label>
                <div class="layui-input-block">
                    <input name="instructor" class="layui-input" disabled="disabled" v-model="interninfo.instructor">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label" >指导老师电话</label>
                <div class="layui-input-block">
                    <input name="instructorphone" class="layui-input" disabled="disabled" v-model="interninfo.instructorphone">
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label" >实习单位类别</label>
                <div v-if="interninfo.orgattr==1">
                <div class="layui-input-block">
                    <input name="orgattr" class="layui-input" disabled="disabled" value="以前实习的单位">
                </div>
                </div>
                <div v-if="interninfo.orgattr==2">
                    <div class="layui-input-block">
                        <input name="orgattr" class="layui-input" disabled="disabled" value="现在实习的单位">
                    </div>
                </div>
                <div v-if="interninfo.orgattr==3">
                    <div class="layui-input-block">
                        <input name="orgattr" class="layui-input" disabled="disabled" value="想要去实习的单位">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <div v-if="interninfo.state == 3">
                        <input type="button" data-state="2" class="layui-btn" @click="pass" value="通过">
                        <input type="button" data-state="3" class="layui-btn" @click="refuse" value="不通过">
                        <input type="button" class="layui-btn" @click="reload" value="返回">
                    </div>
                    <div v-else>
                        <input type="button" class="layui-btn" @click="reload" value="返回">
                    </div>
                </div>
            </div>
        </form>
    </div>

    <%--学生详情--%>
   <div v-show="studentShow">
           <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
               <legend>学生基本信息</legend>
           </fieldset>
           <form class="layui-form">
               <div class="layui-form-item">
                   <label class="layui-form-label">姓名</label>
                   <div class="layui-input-inline">
                       <input type="text" v-model="user.realname" class="layui-input">
                   </div>
                   <label class="layui-form-label layui-form-newlabel_ren">学号</label>
                   <div class="layui-input-inline">
                       <input type="text" v-model="user.workid" class="layui-input " readonly>
                   </div>
                   <label class="layui-form-label">性别</label>
                   <div class="layui-input-inline">
                       <div v-if="user.sex == 1">
                           <label class="layui-form-label" style="text-align: center">男</label>
                       </div>
                       <div v-else="user.sex == 2">
                           <label class="layui-form-label" style="text-align: center">女</label>
                       </div>
                   </div>
               </div>

               <div class="layui-form-item">
                   <label class="layui-form-label">学校</label>
                   <div class="layui-input-inline">
                       <input type="text" v-model="university.name" class="layui-input" readonly>
                   </div>
                   <label class="layui-form-label">学院</label>
                   <div class="layui-input-inline">
                       <input type="text" v-model="school.name" class="layui-input" readonly>
                   </div>
                   <label class="layui-form-label">系</label>
                   <div class="layui-input-inline">
                       <input type="text" v-model="department.name" class="layui-input" readonly>
                   </div>
               </div>

               <div class="layui-form-item">
                   <label class="layui-form-label">专业</label>
                   <div class="layui-input-inline">
                       <input type="text" v-model="major.name" autocomplete="off" class="layui-input" readonly>
                   </div>

                   <label class="layui-form-label">班级</label>
                   <div class="layui-input-inline">
                       <input type="text" v-model="clazz.name" autocomplete="off" class="layui-input" readonly>
                   </div>
               </div>

               <div class="layui-form-item">
                   <label class="layui-form-label">毕设指导老师</label>
                   <div class="layui-input-inline">
                       <div v-if="teacherInfoPaperName == '' ">
                           <input type="text" value="暂无" class="layui-input" readonly>
                       </div>
                       <div v-else>
                           <input type="text" v-model="teacherInfoPaperName" class="layui-input" readonly>
                       </div>
                   </div>
               </div>

               <div class="layui-form-item">
                   <label class="layui-form-label">实习指导老师</label>
                   <div class="layui-input-inline">
                       <div v-if="teacherInfoInternName==''">
                           <input type="text" value="暂无" class="layui-input" readonly>
                       </div>
                       <div v-else>
                           <input type="text" v-model="teacherInfoInternName" class="layui-input" readonly>
                       </div>
                   </div>
                   <label class="layui-form-label">指导状态</label>
                   <div class="layui-input-inline">
                       <div v-if="studentInfo.advisestate==1">
                           <input type="text" value="导师申请中" class="layui-input" readonly>
                       </div>
                       <div v-else="studentInfo.advisestate==2">
                           <input type="text" value="导师已确认" class="layui-input" readonly>
                       </div>
                   </div>
               </div>

               <div class="layui-form-item">
                   <label class="layui-form-label">实习分数</label>
                   <div class="layui-input-inline">
                       <input type="text" v-model="studentInfo.internscore" class="layui-input" readonly>
                   </div>
                   <label class="layui-form-label">实习状态</label>
                   <div class="layui-input-inline">
                       <div v-if="studentInfo.state==1">
                           <input type="text" value="未实习" class="layui-input" readonly>

                       </div>
                       <div v-else-if="studentInfo.state==2">
                           <input type="text" value="实习申请中" class="layui-input" readonly>

                       </div>
                       <div v-else-if="studentInfo.state==3">
                           <input type="text" value="实习中" class="layui-input" readonly>

                       </div>
                       <div v-else-if="studentInfo.state==4">
                           <input type="text" value="实习变更申请中" class="layui-input" readonly>

                       </div>
                       <div v-else="studentInfo.state==-1">
                           <input type="text" value="已毕业" class="layui-input" readonly>
                       </div>
                   </div>

               </div>

               <div class="layui-form-item">
                   <label class="layui-form-label">实习评价</label>
                   <textarea v-model="studentInfo.advisorappraise" disabled="disabled"></textarea>
               </div>

               <div class="layui-form-item">
                   <div class="layui-input-block">
                       <input type="button" class="layui-btn" @click="reload" value="返回">
                   </div>
               </div>
           </form>
       </div>


</div>

<!--模板-->
<script type="text/html" id="tpl">
    {{# layui.each(d.data, function(index, item){ }}
    <tr>

        <td>{{ item.studentInfoDetail.user.workid|| "-" }}</td>
        <td>{{ item.studentInfoDetail.user.realname|| "-" }}</td>

        <td>{{# if(item.orgInfo != null){ }}
            {{ item.orgInfo.fullname  || "暂无" }}
            {{# }; }}
            {{# if(item.orgInfo == null){ }}
            {{ "暂无" }}
            {{# }; }}
        </td>
        <td>{{# if(item.internInfo != null){ }}
            {{ item.internInfo.position || "暂无"}}
            {{# }; }}
            {{# if(item.internInfo == null){ }}
            {{ "暂无" }}
            {{# }; }}</td>
        <td>{{ item.studentInfoDetail.teacherInfoInternName || "-"}}</td>
            {{#  if(item.studentInfoDetail.studentInfo.state == 1){ }}
        <td> 未实习</td>
            {{#  }; }}
            {{#  if(item.studentInfoDetail.studentInfo.state == 2){ }}
        <td>实习申请中</td>
            {{#  }; }}
            {{#  if(item.studentInfoDetail.studentInfo.state == 3){ }}
        <td>实习中</td>
            {{#  }; }}
        {{#  if(item.studentInfoDetail.studentInfo.state == 4){ }}
        <td>实习变更申请中</td>
            {{#  }; }}

        {{#  if(item.studentInfoDetail.studentInfo.state == 1){ }}
       <td> <a href="javascript:;" data-id="{{item.studentInfoDetail.user.id}}" data-opt="mores"
               class="layui-btn layui-btn-normal layui-btn-mini">学生详情</a></td>
             {{#  }; }}
             {{#  if(item.studentInfoDetail.studentInfo.state == 2&&item.internInfo.state == 3){ }}
        <td> <a href="javascript:;" data-id="{{item.studentInfoDetail.user.id}}" data-opt="mores"
                class="layui-btn layui-btn-normal layui-btn-mini">学生详情</a>
         <a href="javascript:;" target="_self" data-id="{{item.internInfo.id}}" data-opt="more"
            class="layui-btn layui-btn-normal layui-btn-mini" style="background-color: #009688;">审核</a>
            {{#  }; }}

            {{#  if(item.studentInfoDetail.studentInfo.state == 2&&item.internInfo.state !== 3){ }}
        <td> <a href="javascript:;" data-id="{{item.studentInfoDetail.user.id}}" data-opt="mores"
                class="layui-btn layui-btn-normal layui-btn-mini">学生详情</a></td>
            {{#  }; }}
        {{#  if(item.studentInfoDetail.studentInfo.state == 3){ }}
        <td> <a href="javascript:;" data-id="{{item.studentInfoDetail.user.id}}" data-opt="mores"
                class="layui-btn layui-btn-normal layui-btn-mini">学生详情</a>
            <a href="javascript:;" target="_self" data-id="{{item.internInfo.id}}" data-opt="more"
               class="layui-btn layui-btn-normal layui-btn-mini">实习详情</a></td>
        </td>
            {{#  }; }}
        <%--{{#  if(item.studentInfoDetail.studentInfo.state == 4&&item.internInfo.state !== 3){ }}--%>
        <%--<td> <a href="javascript:;" data-id="{{item.studentInfoDetail.user.id}}" data-opt="mores"--%>
                <%--class="layui-btn layui-btn-normal layui-btn-mini">学生详情</a>--%>
            <%--<a href="javascript:;" target="_self" data-id="{{item.internInfo.id}}" data-opt="more"--%>
               <%--class="layui-btn layui-btn-normal layui-btn-mini">实习详情</a></td>--%>
        <%--{{#  }; }}--%>
        {{#  if(item.studentInfoDetail.studentInfo.state == 4){ }}
        <td> <a href="javascript:;" data-id="{{item.studentInfoDetail.user.id}}" data-opt="mores"
                class="layui-btn layui-btn-normal layui-btn-mini">学生详情</a>
            <a href="javascript:;" target="_self" data-id="{{item.internInfo.id}}" data-opt="more"
               class="layui-btn layui-btn-normal layui-btn-mini">实习详情</a>
            <a href="javascript:;" target="_self" data-id="{{item.studentInfoDetail.studentInfo.id}}" data-opt="internChange"
               class="layui-btn layui-btn-danger layui-btn-mini">实习变更审核</a>
        </td>
        {{#  }; }}
    </tr>
    {{# }); }}
</script>


<%--审核意见模板--%>
<script type="text/html" id="auditsugtpl">
    {{# var item=d }}
    <div>
        <div class="layui-field-box">
            <div class="layui-form-item layui-form-text">
                <textarea  id="auditsug" class="layui-textarea" name="auditsug" value="{{item.auditsug}}"placeholder="请给出建议">{{item.auditsug}}</textarea>
            </div>
        </div>
    </div>
</script>
<script src="../../static/js/admin/interninfo.js"></script>

<%--获取该行政人员的学院ID--%>
<script>
    var  publisherid = ${sessionScope.currentUser.getId()};
    var admin = {};
    axios.get('/magfacultyinfo/findOne/'+publisherid)
        .then(function (response) {
//            console.log(response.data);
            admin = response.data.data.magFacultyInfo;
            console.log(admin);
        })
        .catch(function (msg) {
            console.log(msg);
        })
    console.log(admin);
</script>
<script>

</script>
</body>
</html>
